package IC.AST.nodes;

import IC.AST.*;

/**
 * a class member variable
 */
public class MemberVar extends Variable {
	private Expression instance;	// the class instance specifier
	private String ID;	// the member variable name

	/**
	 * @param instance the class instance specifier
	 * @param ID the member variable name
	 * @param line the node line number
	 * @param column the node column number
	 */
	public MemberVar(Expression instance, String ID, int line, int column) {
		super(line,column);
		this.instance = instance;
		this.ID = ID;
	}

	/**
	 * @return the class instance specifier
	 */
	public Expression getInstance() {
		return this.instance;
	}

	/**
	 * @return the member variable name
	 */
	public String getID() {
		return this.ID;
	}

	public Object accept(Visitor v) {
		return v.visit(this);
	}
}
